home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10523 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: access.mbnet.mb.ca!natewild
  2. From: natewild@mbnet.mb.ca (Nathan T. Wild)
  3. Newsgroups: comp.os.msdos.programmer,comp.lang.c
  4. Subject: Writing A Pointer To Memory
  5. Date: 18 Mar 1996 13:46:06 GMT
  6. Organization: The University of Manitoba
  7. Message-ID: <4ijpev$ev8@canopus.cc.umanitoba.ca>
  8. NNTP-Posting-Host: access.mbnet.mb.ca
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11.  
  12.  
  13. I know this is s fairly stupid question, but I am having a remarkable
  14. amount of confusion over it...
  15.  
  16.  
  17. I have a far * to a structure.  I need to share this with a device driver, by
  18. writing the pointer to a location in memory.
  19.  
  20. the location in RAM that I have to write to is 2xsizeof(far *) or 8 bytes back
  21. from a specific location in memory.
  22.  
  23. I know where I need to write the pointer, and what I need to write, but for
  24. some strange reason I cannot get it to do what I want...
  25.  
  26. take:
  27.  
  28. void far *ptr = far pointer to a structure;
  29.  
  30. desiredDestinationPtr = (locationPtr - sizeof(void far *));
  31.  
  32. All I want to do is copy the 4 byte seg/offset pointer that ptr points to
  33. into physical memory...  Aargh...  It shouldn't be this difficult...  
  34. Too much coffee...  Please respond via email asap...
  35.  
  36. Thanks
  37.